const path = require("path");
const HtmlwebpackPlugin = require ('html-webpack-plugin');   //需求导入

const VueLoaderPlugin = require("vue-loader/lib/plugin");
const htmlPlugin = new HtmlwebpackPlugin({ //创建插件的实例对象
    template:'./src/09tab选项卡2.html', //指定要用到的模板文件
    filename:'09tab选项卡2.html'    //指定生成的文件的名称，该文件存在于内存中，在目录中不显示
});

module.exports = {
    mode:"development",
    plugins: [htmlPlugin,new VueLoaderPlugin()],  //挂载插件
    entry:"./src/index.js",//打包入口文件的路径
    output:{
        path:path.resolve(__dirname,"dist"), // 输出文件的存放路径
        filename:"bundle.js"  //输出文件的名称
    },
    module: {
        rules: [
            { test:/\.css$/, use: ['style-loader', 'css-loader', 'postcss-loader'] },
            {
                test:/\.jpg|png|gif|bmp|ttf|eot|svg|woff|woff2$/,
                use: 'url-loader?limit= 16940'
            },
            {test: /\.js$/,use: 'babel-loader',exclude:/node_modules/},
            {test:/\.vue$/,use:"vue-loader"}
        ]
    }
};
